// $mainColor: #68bf4a;
// $focusColor: #517397;
// $defaultColor: #DEDEDE;
// $dangerColor: #ff6c60;
@mixin width($expression) {
  width: -moz-calc(#{$expression});
  width: -webkit-calc(#{$expression});
  width: calc(#{$expression});
}

@mixin height($expression) {
  height: -moz-calc(#{$expression});
  height: -webkit-calc(#{$expression});
  height: calc(#{$expression});
}

@mixin calc_fun($name,$expression) {
  #{$name}: -moz-calc(#{$expression});
  #{$name}: -webkit-calc(#{$expression});
  #{$name}: calc(#{$expression});
}

@mixin opacity($default,$ie) {
  /* older safari/Chrome browsers */
  -webkit-opacity: #{$default};
  /* Netscape and Older than Firefox 0.9 */
  -moz-opacity: #{$default};
  /* Safari 1.x (pre WebKit!) 老式khtml内核的Safari浏览器*/
  -khtml-opacity: #{$default};
  /* IE9 + etc...modern browsers */
  opacity: #{$default};
  /* IE 4-9 */
  filter: alpha(opacity=#{$ie});
  /*This works in IE 8 & 9 too*/
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$ie})";
  /*IE4-IE9*/
  filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=#{$ie});
}
@mixin overflow-ellipsis() {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@mixin placeholder($color){
  :-moz-placeholder { /* Mozilla Firefox 4 to 18 */
    color: $color;
  }

  ::-moz-placeholder { /* Mozilla Firefox 19+ */
    color: $color;
  }

  input:-ms-input-placeholder,
  textarea:-ms-input-placeholder {
    color: $color;
  }

  input::-webkit-input-placeholder,
  textarea::-webkit-input-placeholder {
    color: $color;
  }
}
@mixin bg-img($img) {
  background-image: url($img);
  filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='#{$img}', sizingMethod='scale');
  -ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='#{$img}', sizingMethod='scale')";
}
.bg_img{
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center 0;
  -webkit-background-size: cover;
  -moz-background-size: cover;
}
@mixin border-radius($expression){
  -moz-border-radius: #{$expression};
  -webkit-border-radius: #{$expression};
  border-radius: #{$expression};
}
.iconfont {
  font-family:"iconfont" !important;
  font-size:0.425rem;
  font-style:normal;
  -webkit-font-smoothing: antialiased;
  -webkit-text-stroke-width: 0.2px;
  -moz-osx-font-smoothing: grayscale;
}

@mixin keyframes($animation-name) {
  @-webkit-keyframes #{$animation-name} {
    @content;
  }
  @-moz-keyframes #{$animation-name} {
    @content;
  }
  @keyframes #{$animation-name} {
    @content;
  }
}

@mixin px2rem($property,$px-values,$baseline-px:16px,$support-for-ie:false){
    //Conver the baseline into rems
    $baseline-rem: $baseline-px / 1rem * 1;
    //Print the first line in pixel values
    @if $support-for-ie {
        #{$property}: $px-values;
    }
    //if there is only one (numeric) value, return the property/value line for it.
    @if type-of($px-values) == "number"{
        #{$property}: $px-values / $baseline-rem;
    }
    @else {
        //Create an empty list that we can dump values into
        $rem-values:();
        @each $value in $px-values{
            // If the value is zero or not a number, return it
            @if $value == 0 or type-of($value) != "number"{
                $rem-values: append($rem-values, $value / $baseline-rem);
            }
        }
        // Return the property and its list of converted values
        #{$property}: $rem-values;
    }
}
